<template>
	<view>
		<view v-if="isVideo == 0" class="vedio-item" @click="toUrl(data.id)">
			<view class="vedio-title container">
				<view class="source">
					<view class="source-img">
						<image src="../../static/logo2.png" mode=""></image>
					</view>
					<view class="source-name">
						{{data.source}}
					</view>
				</view>
				<view class="vedio-item-title">
					{{data.title}}
				</view>
			</view>
			<view class="vedio">
				<view class="uni-vedio-container">
					<video :src="'/api'+data.video" class="uni-video-video" :poster="'/api'+data.image"></video>
				</view>
			</view>
			<view class="video-item-bottom" style="border-bottom: 1upx solid #f4f4f4;">
				<view class="bottom-content" style="display: flex;align-items: center;">
					<image src="../../static/g20.png"></image>
					<view class="bottom-text">{{data.browseNum}}</view>
				</view>
			</view>
		</view>
		<view v-else class="vedio-item">
			<view class="vedio-title container">
				<view class="source" style="height: 104rpx;">
					<view class="source-img source-img2">
						<image src="../../static/logo2.png"></image>
					</view>
					<view class="source-name">
						{{data.source}}
					</view>
				</view>
			</view>
			<view class="vedio">
				<view class="uni-vedio-container">
					<video :src="'/api'+data.video" class="uni-video-video" :poster="'/api'+data.image"></video>
				</view>
			</view>
			<view class="video-item-bottom" style="height: 138rpx;">
				<view class="bottom-content" style="height: 138rpx;margin-left: -80rpx;">
					<view class="bottom-title">
						{{data.title}}
					</view>
					<view class="bottom-text2">{{data.browseNum}} 播放&emsp;|&emsp;发布时间:{{data.updateTime}}</view>
				</view>
			</view>
			<view class="line"></view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "video-list",
		props: {
			videoData: {},
			isVideo: 0
		},
		data() {
			return {
				data: {}
			};
		},
		mounted() {
			this.data = this.videoData
		},
		methods:{
			toUrl(e){
				uni.navigateTo({
					url:'../../subpages/news-detail/news-detail?id='+e+'&i=1'
				})
			}
		}
	}
</script>

<style lang="scss">
	.video-item {
		box-sizing: border-box;
	}

	.vedio-title {
		font-family: NotoSansHans-Regular;
		font-size: 28upx;
		font-weight: 700;
		font-stretch: normal;
		line-height: 36upx;
		letter-spacing: 0;
		color: #000;
	}

	.container {
		width: 100%;
		box-sizing: border-box;
		background-color: #fff;
		padding: 0 20upx;
	}

	.source {
		display: flex;
		align-items: center;
		width: 100%;
		height: 90upx;
		background-color: #fff;

		.source-img {
			width: 50upx;
			height: 50upx;
			border-radius: 50%;
			border: solid 1px #eee;
			display: flex;

			image {
				height: 30upx;
				width: 40upx;
				margin: auto;
			}
		}

		.source-img2 {
			width: 70upx;
			height: 70upx;
			border-radius: 50%;
			border: solid 1px #eee;
			display: flex;

			image {
				height: 49upx;
				width: 64upx;
				margin: auto;
			}
		}

		.source-name {
			font-family: NotoSansHans-Regular;
			font-size: 28upx;
			font-weight: 700;
			font-stretch: normal;
			line-height: 22upx;
			letter-spacing: 0;
			color: #000;
			margin-left: 16upx;
		}
	}

	.vedio-item-title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
		margin-bottom: 16upx;
	}

	.vedio {
		width: 100%;
		height: 426upx;
		position: relative;

		.uni-vedio-container {
			width: 100%;
			height: 100%;
			background-color: #000;
			display: inline-block;
			position: absolute;
			top: 0;
			left: 0;
			overflow: hidden;
			object-position: inherit;

			.uni-video-video {
				width: 100%;
				height: 100%;
				object-position: inherit;
			}
		}
	}

	.video-item-bottom {
		padding-left: 100Upx;
		height: 60upx;
		font-family: NotoSansHans-Regular;
		font-size: 22upx;
		font-weight: 400;
		font-stretch: normal;
		line-height: 60upx;
		letter-spacing: 0;
		color: #747e8c;

		image {
			width: 34upx;
			height: 34upx;
		}
	}

	.bottom-content {
		.bottom-title {
			font-family: NotoSansHans-Bold;
			font-size: 34rpx;
			font-weight: 400;
			font-stretch: normal;
			line-height: 36rpx;
			letter-spacing: 0;
			color: #000;
		}

		.bottom-text {
			margin-left: 12upx
		}

		.bottom-text2 {
			font-family: NotoSansHans-Regular;
			font-size: 26rpx;
			font-weight: 400;
			font-stretch: normal;
			line-height: 68rpx;
			letter-spacing: 0;
			color: #ababab;
		}
	}

	.line {
		width: 100%;
		height: 22rpx;
		background-color: #f7f8f9;
		opacity: .95;
	}
</style>
